import Vue from "vue";

import "normalize.css/normalize.css"; // A modern alternative to CSS resets 设置统一的css样式
// 安装element-ui
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

import "@/styles/index.scss"; // global css

import App from "./App";
import store from "./store";
import router from "./router";
import MyPlugin from "@/components";
import i18n from "@/lang";

import "@/icons"; // icon
import "@/permission"; // permission control

Vue.use(MyPlugin);

// Vue.use(ElementUI, {
//   i18n: (key, value) => i18n.t(key, value),
// });
Vue.use(ElementUI);
Vue.config.productionTip = false;
import * as directives from "@/directive";
// 对象获取关键字数组，遍历数组给没有关键字注册组件
console.log(directives);
Object.keys(directives).forEach((keys) => {
  // keys就是我们暴露出来的函数名，directives[keys]就是函数的具体内容
  Vue.directive(keys, directives[keys]);
});
new Vue({
  el: "#app",
  router,
  store,
  i18n,
  render: (h) => h(App),
});
